package com.example.gate.net;


import io.netty.channel.Channel;


/**
 * @author: Allen
 * @create: 2025/7/9 10:06
 * @description: 通用
 **/
public abstract class Session {

    /**
     * 关联的 netty channel
     */
    private Channel channel;

    /**
     * 账号id
     */
    private long accountId;

    /**
     * 玩家id
     */
    private int userId;

    /**
     * 帐号是否已经登录
     * @return
     */
    public abstract boolean isAccountLogin();

    /**
     * 用户是否已经登录
     * @return
     */
    public abstract boolean isUserLogin();

    public Session(Channel channel, long accountId, int userId) {
        this.channel = channel;
        this.accountId = accountId;
        this.userId = userId;
    }

    public Channel getChannel() {
        return channel;
    }

    public void setChannel(Channel channel) {
        this.channel = channel;
    }

    public long getAccountId() {
        return accountId;
    }

    public void setAccountId(long accountId) {
        this.accountId = accountId;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }


}
